/**
 * Created by lijinde on 2018/3/15.
 */

let Response = {
  success:true,
  data:null,
  message:''
}
let GenericResponse = (msg,result = {},success = false)=>{
  let response = Object.assign({},Response)
  let data = Object.assign({},result)
  delete data.objectId
  delete data.createdAt
  delete data.updatedAt
  response.success = success
  response.data = data._serverData || {}
  response.message = msg
  return JSON.stringify(response)
}

module.exports = {
  Response,GenericResponse
}
